package com.crypt.properties.algorithm;

import com.crypt.properties.factory.CryptFactory;

import java.util.Map;

public abstract class AbstractCryptAlgorithm implements CryptAlgorithm {

    protected Map<String, Object> properties;

    public AbstractCryptAlgorithm() {
        String algorithm = this.getAlg();
        if (algorithm != null || algorithm.length() > 0) {
            CryptFactory.instance().addCryptAlgorithm(algorithm, this);
        }
    }

    @Override
    public void setProperties(Map<String, Object> properties) {
        this.properties = properties;
    }
}
